﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;

namespace WeForms
{
    public class WeTabSideBarScrollBar : WeTabSideBarControl
    {
       
        #region Overrides of WeTabSideBarControl

        public override Size GetPreferredSize(Size proposedSize)
        {
            return WeTabTheme.ScrollBarSize;
        }

        protected override void SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified)
        {
            base.SetBoundsCore(x, y, WeTabTheme.ScrollBarSize.Width, WeTabTheme.ScrollBarSize.Height, specified);
        }

        #endregion

        protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
        {
            base.OnPaintBackground(pevent);
            using (Brush brush = new SolidBrush(WeTabTheme.SideBarBackground))
            {
                pevent.Graphics.FillRectangle(brush, new Rectangle(Point.Empty, WeTabTheme.ScrollBarSize));
            }
            using (Pen p = new Pen(WeTabTheme.ScrollBarBorder))
            {
                pevent.Graphics.DrawRectangle(p, new Rectangle(0, 0, WeTabTheme.ScrollBarSize.Width - 1, WeTabTheme.ScrollBarSize.Height-1));
            }
        }

        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            base.OnPaint(e);

            Rectangle clientRegion = new Rectangle(1, 1, WeTabTheme.ScrollBarSize.Width - 2,
                                                   WeTabTheme.ScrollBarSize.Height - 2);
            // TODO: Draw Screenshot of Current View
            using (Brush b = new SolidBrush(WeTabTheme.ScrollBarOverlay))
            {
                 // Draw Top shadow
                e.Graphics.FillRectangle(b, clientRegion);
            }
        }
    }
}
